<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>


    <title>H+ 后台主题UI框架 - 查看邮件</title>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.css}" rel="stylesheet"/>
    <link th:href="@{/css/plugins/iCheck/custom.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.css}" rel="stylesheet"/>

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-content mailbox-content">
                    <div class="file-manager">
                        <a class="btn btn-block btn-primary compose-mail" href="/message/toSendPage">发送留言</a>
                        <div class="space-25"></div>
                        <h5>文件夹</h5>
                        <ul class="folder-list m-b-md" style="padding: 0">
                            <li>
                                <a href="/message/toMessagePage/1?status=-3"> <i class="fa fa-inbox "></i> 留言箱 <span
                                        class="label label-warning pull-right" th:if="${unreads != null}"
                                        th:text="${unreads}">16</span>
                                </a>
                            </li>
                            <li>
                                <a href="/message/toMessagePage/1?status=-1"> <i class="fa fa-file-text-o"></i> 草稿 <span
                                        class="label label-info pull-right" th:if="${draft != null}" th:text="${draft}">1</span>
                                </a>
                            </li>
                            <li>
                                <a href="/message/toMessagePage/1?status=-2"> <i class="fa fa-trash-o"></i> 垃圾箱<span
                                        class="label label-danger pull-right" th:if="${garbage != null}"
                                        th:text="${garbage}">2</span></a>
                            </li>
                        </ul>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-9 animated fadeInRight">
            <div class="mail-box-header">
                <div class="pull-right tooltip-demo">
                    <a href="mail_compose.html" class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top"
                       title="回复" th:if="${message.msgStatus == -3}"><i class="fa fa-reply"></i> 回复</a>
                    <a href="#" id="markId"  class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top"
                       title="标为垃圾邮件" th:if="${message.msgStatus == -3}"><i class="fa fa-trash-o"></i> </a>
                </div>
                <h2>
                    查看邮件
                </h2>
                <div class="mail-tools tooltip-demo m-t-md">


                    <h3>
                        <span class="font-noraml">主题： </span><span th:text="${message.msgTitle}"></span>
                    </h3>
                    <h5>
                        <span class="pull-right font-noraml"
                              th:text="${#dates.format(message.msgTime,'yyyy年MM月dd日HH时')}"></span>
                        <span class="font-noraml">发件人： </span><span th:text="${message.msgSenderEmail}"></span>
                    </h5>
                </div>
            </div>
            <div class="mail-box ">
                <p></p>
                <div class="summernote">

                </div>
                <div class="clearfix"></div>

                <div class="mail-body text-right tooltip-demo">
                    <a class="btn btn-sm btn-white" href="mail_compose.html" th:if="${message.msgStatus == -3}"><i class="fa fa-reply"></i> 回复</a>
                    <button title="" data-placement="top" data-toggle="tooltip" data-original-title="删除邮件"
                            class="btn btn-sm btn-white" id="delButton" th:if="${message.msgStatus == -2}"><i class="fa fa-trash-o"></i> 删除
                    </button>
                </div>
                <div class="clearfix"></div>


            </div>
        </div>
    </div>
</div>


<!-- 全局js -->
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>


<!-- 自定义js -->
<script th:src="@{/js/content.js}"></script>
<script th:src="@{/js/plugins/layer/layer.min.js}"></script>

<!-- iCheck -->
<script th:src="@{/js/plugins/iCheck/icheck.min.js}"></script>

<script th:src="@{/js/plugins/summernote/summernote.min.js}"></script>
<script th:src="@{/js/plugins/summernote/summernote-zh-CN.js}"></script>
<script th:inline="javascript">
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
        $('.summernote').summernote({
            lang: 'zh-CN',
            height: 200
        });
        // $('#summernote').summernote('disable');
        $('.summernote').code([[${message.msgContent}]]);
        // $($("#summernote").summernote("code",[[${message.msgContent}]])).text();
        $('.summernote').destroy();
        $("#markId").on("click",function () {
            $.ajax({
                url: "/message/mark",
                type: "post",
                data: {
                    msgId: [[${message.msgId}]],
                    msgStatus:-2
                },
                success: function (data) {
                    if (data.code == 200) {
                        location.href = "/message/toMessagePage/1?status=-3";
                    } else {
                        layer.msg(data.msg);
                    }
                }
            });
        });
        $("#delButton").on("click",function () {
            $.ajax({
                url: "/message/remove",
                type: "post",
                data: {
                    msgId: [[${message.msgId}]]
                },
                success: function (data) {
                    if (data.code == 200) {
                        location.href = "/message/toMessagePage/1?status=-2";
                    } else {
                        layer.msg(data.msg);
                    }
                }
            });
        });
    });
</script>

<!--<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>-->
<!--&lt;!&ndash;统计代码，可删除&ndash;&gt;-->

</body>

</html>
